package com.william.lifetraxer;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
import android.widget.Toast;

public abstract class BasicActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	}
	
	void showMessageToast(CharSequence msg , int duration)
	{
		Toast.makeText(this, msg , duration).show();
	}
	
	Dialog createSimpleDialog(int icon , CharSequence titleMsg 
			, CharSequence mainMsg , CharSequence posButtonMsg , 
			DialogInterface.OnClickListener posListener ,
			CharSequence nagButtonMsg , DialogInterface.OnClickListener nagListener)
	{
		AlertDialog.Builder builder = new AlertDialog.Builder(this);
		
		builder.setIcon(icon).setTitle(titleMsg).setMessage(mainMsg)
		.setPositiveButton(posButtonMsg,posListener);
		
		if(nagButtonMsg!=null)
		{
			builder.setNegativeButton(nagButtonMsg,nagListener);
		}
		return builder.create();
	}
	
}
